import axios from 'axios'

const insted = axios.create({
    baseURL: "/",
    timeout: 60000
})



export function ajax(options) {
    const { url, method = 'get', data = {} } = options

    if (method.toUpperCase() === 'GET') {
        return insted.get(url, { params: data })
    } else {
        return insted.post(url, data)
    }
}